# 加载数据库连接驱动
import mysql.connector

# 连接到MySQL数据库
mydb = mysql.connector.connect(
  host="128.26.20.68",
  user="lidong",
  password="123456",
  database="world"
)

# 创建游标对象
mycursor = mydb.cursor()


# 执行SQL查询
sql = "SELECT * FROM city WHERE Name = %s"
adr = ("Qandahar", )
mycursor.execute(sql, adr)

# 获取查询结果
myresult = mycursor.fetchall()

# 打印结果
for x in myresult:
  print(x)